package com.HW;

import java.util.Arrays;
import java.util.Scanner;
import java.util.logging.Level;

/**
 * @ClassName : TMastLang
 * @Author : kele
 * @Date: 2023/11/1 20:42
 * @Description :
 */
public class TMastLang {

    public static void main(String[] args) {

//        Scanner sc = new Scanner(System.in);
//        handle(sc.nextLine());

        handle("[\"bbc\",\"bbc\",\"bbc\"]");

    }

    public static void handle(String str) {

        String[] strings = Arrays.stream(str.substring(1, str.length() - 1).replace("\"", "").split(",")).toArray(String[]::new);

        if (strings.length == 1) {
            System.out.println("\"" + strings[0] + "\"");
            return;
        }


        String max = strings[0].substring(strings[0].length() - 1);
        for (int i = 1; i <= strings[0].length(); i++) {

            max = strings[0].substring(strings[0].length() - i);

            for (int j = 1; j < strings.length; j++) {

                if (!strings[j].endsWith(max)) {

                    if(max.length() == 1){
                        System.out.println("@Zero");
                    }else{
                        System.out.println(max.substring(1));
                    }
                    return;
                }
            }
        }

        System.out.println(max);



    }
}
